<?php

/**
 * 前台 前页面 模块 Controller
 * ============================================================================
 * TBlog TBlog博客系统　BY Tmac PHP MVC framework
 * $Author: zwt007 $  <zwttmac@qq.com>
 * $Id: page.php 40 2011-07-11 17:15:06Z zwt007 $
 * http://www.t-mac.org；
 */
class pageAction extends Action
{

    private $tmp_model;
    private $show_model;
    private $index_model;

    public function _init()
    {
        $this->assign('action', $_GET['TMAC_ACTION']);
        $this->tmp_model = Tmac::model('news');
        $this->show_model = Tmac::model('show');
        $this->index_model = Tmac::model('index');
        $this->M('index')->getCommon();
    }

    public function index()
    {
        $name = $this->H($this->getParam('name'));
        $name = empty($name) ? 'zhaopin' : $name;
        $catinfo = $this->show_model->getCategoryInfo($name);

        $nicename = $this->index_model->getToptypeNmae($name);
        $this->assign('nicename', $nicename);
        $this->assign('catinfo', $catinfo);
        $this->assign('name', $name);
        if ($name == 'zhaopin') {
            $this->V('hr');
        } else {
            $this->V('contact');
        }
    }

}